Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error out when calling rfactor() after fusing a pure var #8268

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

alexreinking
Copy link
Member

Fixes #7854

@alexreinking alexreinking requested a review from abadams June 6, 2024 14:30
@alexreinking alexreinking marked this pull request as draft June 6, 2024 18:39
@alexreinking
Copy link
Member Author

This needs more work.

  1. It doesn't handle a pure var higher up in a tree of fusions; that needs to be fixed somehow
  2. I discovered a secondary bug, as follows:
#include "Halide.h"

using namespace Halide;

int main(int argc, char **argv) {
    Func f{"f"};
    RDom r({{0, 5}, {0, 5}, {0, 5}}, "r");
    Var x{"x"}, y{"y"};
    f(x, y) = 0;
    f(x, y) += r.x + r.y + r.z;

    RVar rxy{"rxy"}, yrz{"yrz"};
    Var z{"z"};

    // Error: In schedule for f.update(0), could not find remove dimension: r$z
    // Vars: r$x.rxy r$z.yrz x __outermost
    f.update()
        .fuse(r.x, r.y, rxy)
        .fuse(r.z, y, yrz)
        .rfactor(rxy, z);

    f.print_loop_nest();

    printf("Success!\n");
    return 0;
}

@alexreinking alexreinking changed the title Add error when calling rfactor on a fused Var+RVar Error out when calling rfactor() after fusing a pure var Jun 7, 2024
@steven-johnson
Copy link
Contributor

What's the status on this PR?

@alexreinking
Copy link
Member Author

What's the status on this PR?

Not close to ready yet. Need to clear my plate a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault on rfactoring an RVar produced by fusing a Var with an RVar
3 participants